package com.godyao.mall.common.exception;

import com.godyao.mall.core.model.ResultCode;
import lombok.Data;

/**
 * @author godyao
 * @date 2022/4/3
 */
@Data
public class ServerException extends RuntimeException{
    private Integer code;

    public ServerException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public ServerException(ResultCode code) {
        super(code.getMsg());
        this.code = code.getCode();
    }
}
